package org.java.desgin.patterns.proxy;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

public class RefectTest {

	private int num=0;
	private String str="hell0";
	private List<String> list=new ArrayList<String>();
	
	public double db=0d;
	
	public static void main(String[] args) throws InstantiationException, IllegalAccessException {
		Class<RefectTest> clzz=RefectTest.class;
		Method mthd[]=clzz.getMethods();
		for(Method md:mthd){
			System.out.println(md.getName());
		}
		
		RefectTest rft=clzz.newInstance();
		rft.refectF();
		
		//Field fld[]=clzz.getFields();
		Field fld[]=clzz.getDeclaredFields();
		System.out.println(fld.length);
		for(Field f:fld){
			System.out.println(f.getName()+"  "+f.getType());
		}
	}
	public int getNum() {
		return num;
	}
	public void setNum(int num) {
		this.num = num;
	}
	public String getStr() {
		return str;
	}
	public void setStr(String str) {
		this.str = str;
	}
	public List<String> getList() {
		return list;
	}
	public void setList(List<String> list) {
		this.list = list;
	}
	public double getDb() {
		return db;
	}
	public void setDb(double db) {
		this.db = db;
	}
	public void refectF(){
		System.out.println("refectF");
	}
}
